﻿using System;
using System.IO;

namespace Studio
{
	// Token: 0x020004A7 RID: 1191
	public abstract class ObjectInfo
	{
		// Token: 0x06001DC1 RID: 7617 RVA: 0x000BC7EC File Offset: 0x000BA9EC
		public ObjectInfo(int _key)
		{
			this.dicKey = _key;
			this.changeAmount = new ChangeAmount();
			this.treeState = TreeNodeObject.TreeState.Close;
			this.visible = true;
			if (this.dicKey != -1)
			{
				Studio.AddChangeAmount(this.dicKey, this.changeAmount);
			}
		}

		// Token: 0x1700032C RID: 812
		// (get) Token: 0x06001DC2 RID: 7618 RVA: 0x000BC83C File Offset: 0x000BAA3C
		// (set) Token: 0x06001DC3 RID: 7619 RVA: 0x000BC844 File Offset: 0x000BAA44
		public int dicKey { get; private set; }

		// Token: 0x1700032D RID: 813
		// (get) Token: 0x06001DC4 RID: 7620
		public abstract int kind { get; }

		// Token: 0x1700032E RID: 814
		// (get) Token: 0x06001DC5 RID: 7621 RVA: 0x000BC850 File Offset: 0x000BAA50
		// (set) Token: 0x06001DC6 RID: 7622 RVA: 0x000BC858 File Offset: 0x000BAA58
		public ChangeAmount changeAmount { get; protected set; }

		// Token: 0x1700032F RID: 815
		// (get) Token: 0x06001DC7 RID: 7623 RVA: 0x000BC864 File Offset: 0x000BAA64
		// (set) Token: 0x06001DC8 RID: 7624 RVA: 0x000BC86C File Offset: 0x000BAA6C
		public TreeNodeObject.TreeState treeState { get; set; }

		// Token: 0x17000330 RID: 816
		// (get) Token: 0x06001DC9 RID: 7625 RVA: 0x000BC878 File Offset: 0x000BAA78
		// (set) Token: 0x06001DCA RID: 7626 RVA: 0x000BC880 File Offset: 0x000BAA80
		public bool visible { get; set; }

		// Token: 0x06001DCB RID: 7627 RVA: 0x000BC88C File Offset: 0x000BAA8C
		public virtual void Save(BinaryWriter _writer, Version _version)
		{
			_writer.Write(this.kind);
			_writer.Write(this.dicKey);
			this.changeAmount.Save(_writer);
			_writer.Write((int)this.treeState);
			_writer.Write(this.visible);
		}

		// Token: 0x06001DCC RID: 7628 RVA: 0x000BC8CC File Offset: 0x000BAACC
		public virtual void Load(BinaryReader _reader, Version _version, bool _import, bool _other = true)
		{
			if (!_import)
			{
				this.dicKey = _reader.ReadInt32();
				Studio.SetNewIndex(this.dicKey);
			}
			else
			{
				_reader.ReadInt32();
			}
			this.changeAmount.Load(_reader);
			if (this.dicKey != -1 && !_import)
			{
				Studio.AddChangeAmount(this.dicKey, this.changeAmount);
			}
			if (_other)
			{
				this.treeState = (TreeNodeObject.TreeState)_reader.ReadInt32();
			}
			if (_other)
			{
				this.visible = _reader.ReadBoolean();
			}
		}

		// Token: 0x06001DCD RID: 7629
		public abstract void DeleteKey();
	}
}
